package com.bishe.bishe.Service.ServiceImpl;

import com.bishe.bishe.Service.UserService;
import com.bishe.bishe.dao.mapper.UserMapper;
import com.bishe.bishe.entity.PageResult;
import com.bishe.bishe.pojo.Comments;
import com.bishe.bishe.pojo.User;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user)throws Exception {
     return userMapper.findall(user);
    }

    @Override
    public int insert(User user) throws Exception {
        return userMapper.insert(user);
    }

    @Override
    public int delete(int userid) {

        return userMapper.delete(userid);
    }

    @Override
    public int update(User user) {
        return userMapper.update(user);
    }

    @Override
    public User finduser(int userId) {
        return userMapper.findUser(userId);
    }

    @Override
    public List<User> findall() {
        return userMapper.find();
    }

    @Override
    public User checkuser(String userEntername) {
        return userMapper.checkuser(userEntername);
    }


}
